package com.bajiao.service.discountRule.impl;

import com.bajiao.entity.discountRule.DiscountRule;
import com.bajiao.mapper.discountRule.DiscountRuleMapper;
import com.bajiao.service.discountRule.DiscountRuleService;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.List;

/**
 * @Description: 店铺优惠规则
 * @Author: FanJq
 * @Date:   2025-01-13
 * @Version: V1.0
 */
@Service
public class DiscountRuleServiceImpl extends ServiceImpl<DiscountRuleMapper, DiscountRule> implements DiscountRuleService {

    /**
     * @Description
     * 获取店铺优惠规则
     * @date 2025/1/13 14:49
     * @author FanJq
     * @param storeId
     * @return {@link DiscountRule}
    */
    @Override
    public List<DiscountRule> getByStoreId(String storeId) {
        List<DiscountRule> ruleList = super.lambdaQuery()
                .eq(DiscountRule::getStoreId, storeId)
                .orderByAsc(DiscountRule::getSeq)
                .list();
        return ruleList;
    }
}
